home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: What does the -O option do???!!!
- Date: 10 Feb 1996 10:52:43 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4fiphrINNrvr@keats.ugrad.cs.ubc.ca>
- References: <4ehger$cj9@mark.ucdavis.edu> <4emlsq$odt@airdmhor.gen.nz> <pronet01.34.003B9BB5@indirect.com> <823827008snz@genesis.demon.co.uk>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <823827008snz@genesis.demon.co.uk>,
- Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
- >In article <pronet01.34.003B9BB5@indirect.com>
- > pronet01@indirect.com "Mark Miller" writes:
- >
- >>move addresses for a pointer variable that you have used "free" on..
- >
- >As far as the C language is concerned the value of a pointer is
- >indeterminate if the object it pointed to has been freed. Therefore code
- >that tries to use the value of a pointer after that has been passed to
- >free is plain broken (except possibly, as has been argued on comp.stc.c,
- >if that value is accessed as a char array). So if a compiler can generate
- >more efficient code my making use of this then that is a good compiler and
- >all correct programs will continue to work with it.
-
- ... as long as it is not hard-coded to treat identifiers like "free" specially.
- If you write your own free() with different semantics, you would not want the
- compiler messing with that. It's just another function, after all. Some
- compilers have special directives that you can apply to function prototypes
- that give a hint to the compiler (for example, hints like "this function does
- not return, so you may treat client code accordingly").
- --
-
-